package com.sirui.x.learn_security.ctl;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/security")
public class IndexController {

	
	@RequestMapping("test")
	public String test() {
		return "test";
	}
	
	@RequestMapping("test1")
	@PreAuthorize("hasAuthority('perms:test1')")
	public String test1() {
		return "test1111";
	}
	
	@RequestMapping("test2")
	@PreAuthorize("hasAuthority('perms:test2')")
	public String test2() {
		return "test22";
	}
}
